<%--
  Created by IntelliJ IDEA.
  User: l
  Date: 2022/5/8
  Time: 14:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <link rel="stylesheet" type="text/css" href="css/public.css"/>
    <link rel="stylesheet" type="text/css" href="css/login.css"/>
    <script src="js/function1.js"></script>
    <script src="js/jquery-1.12.4.min.js"></script>
    <style>
        .reg p .error{
            display:  inline-block;
            color: red;
            font-size: 15px;
            margin-left: 10px;
        }
    </style>
</head>
<body><!-------------------login-------------------------->
<div class="login">
    <form action="http://localhost:8080/lyq/admin/login" onsubmit="return checkForm(this)" method="post"><h1><a href="index.html"><img src="img/temp/logo.png"></a></h1>
        <p></p>
        <div class="msg-warn hide"><b></b>公共场所不建议自动登录，以防账号丢失</div>
        <p><input type="text" name="username" id="username" onfocus="FocusItem(this)" onblur="CheckItem(this)" value="${username}" placeholder="用户名"><span style="color: red"></span></p>
        <p><input type="password" name="pass" id="pass" onfocus="FocusItem(this)" onblur="CheckItem(this)" value="${password}" placeholder="密码"><span style="color: red"></span></p>
        <p><input type="submit" name="" value="登  录"></p>
        <p class="txt"><a class="" href="reg.jsp">免费注册</a><a href="forget.jsp">忘记密码？</a></p></form>
</div>
<script>
    function getCK(mkey) {
        var name = cname + "=";
        var ca = document.cookie.split(';');
        for(var i=0; i<ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1);
            if (c.indexOf(name) != -1) return c.substring(name.length, c.length);
        }
        return "";
    }
    window.onload=function () {
        var username = getCK("username");
        var password = getCK("password");
        $("#username").val(username);
        $("#pass").val(password);
    }
</script>
</body>
</html>
